package hello

import (
	"context"
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/template-single/api/hello/v1"
	"github.com/gogf/template-single/internal/ker/mod"
)

func (c *ControllerV1) Hello(ctx context.Context, req *v1.DIReq) (res *v1.Res, err error) {
	do, err := mod.Am.ReadDI()
	g.RequestFromCtx(ctx).Response.WriteJson(do)
	return
}

func (c *ControllerV1) Hellow(ctx context.Context, req *v1.DOReq) (res *v1.Res, err error) {
	err = mod.Am.WriteDO(uint16((req.X%6)+0x10), req.Y > 0)
	return
}
